home *** CD-ROM | disk | FTP | other *** search
- /*
- * Generic Inherited list module, written by Richard Clark
- */
-
- OPT MODULE
- OPT EXPORT
-
-
- OBJECT node
- next:PTR TO node
- prev:PTR TO node
- ENDOBJECT
-
- PROC del() OF node
- /*
- * detaches current node, patching up links in list.
- */
-
- IF self.next<>NIL THEN self.next.prev:=self.prev
- IF self.prev<>NIL THEN self.prev.next:=self.next
-
- ENDPROC
-
- PROC del_list() OF node
- /*
- * Sets off a chain of destruction that ENDs every node in the list.
- */
-
- IF self.next THEN self.next.del_list()
-
- END self
-
- ENDPROC
-
- PROC add(nde:PTR TO node) OF node
- /*
- * Adds a node to the end of the list
- */
-
- IF self.next
- self.next.add(nde)
- ELSE
- self.next:=nde
- nde.prev:=self
- ENDIF
-
- ENDPROC
-